package text_2023_09_21;

import java.util.Scanner;

/**
 * @author Vv
 * @version 1.0
 * @project coding_learn
 * @description
 * @date 2023/9/21 11:36:35
 */
public class CountString {
    public String T;
    public String S;
    public CountString(String s,String t){
        this.S = s;
        this.T = t;
    }
    public int count(){
        int count = 0;
        for(int i = 0;i<T.length() - S.length();i = T.indexOf(S,i)+1){
            if(T.indexOf(S,i)!=-1){
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
//        String str = "ejrbfgghsrk";
//        System.out.println(str.indexOf("ggh"));
//        System.out.println(str.replace('g','h'));
//        System.out.println(str.replaceAll("srk","ggg"));
        Scanner scanner = new Scanner(System.in);
        String T = scanner.next();
        String S = scanner.next();
        String str = T.replace(S,"");
        int count = T.length() - str.length();
        count /= S.length();
        System.out.println(S + "在" + T +"中出现的次数" + count);
    }

}
